<script setup>
import {onMounted, ref} from "vue";
import cpn from "@components/cpn.vue"

const getDom = ref(null);



onMounted(() =>{
  // console.log(getDom.value)
})

const handleClick = () => {
  getDom.value.focus();
}

const testCpn = ref(null);
onMounted(() => {
  console.log(testCpn.value.count)
  testCpn.value.handleFn()
})
</script>


<template>
  <button @click="handleClick">获取焦点</button>
  <input type="text" name="" id="" ref="getDom">

  <cpn ref="testCpn"/>
</template>